#include "SkillFlash.h"
#include "Character/SkillPart.h"


SkillFlash::SkillFlash()
{

}

void SkillFlash::OnDamageTimedo(uint32_t skillId)
{
	cList tmplist;
	stSkillInfo *pSkill = m_pPart->GetSkillInfo(skillId);
	MMOLOG_PROCESS_ERROR(pSkill);

	m_pPart->KillTimedo(m_nGlobelID);
	//创建几个怪，用于测试  --------------
	//Point3<float> nPos = m_pPart->GetMasterPos();
	//for (int i = 0; i < 20;++i)
	//{
	//	nPos.x += 1;
	//	g_GetMonsterMgr()->CreateMonster(220110105, m_pPart->GetMaster()->GetSceneId(), nPos);
	//}
	//------------------
	//把玩家置到目标点上
	m_pPart->Teleporting(m_targetPos);

	////发送技能结果消息
	//UseSkillResult result;
	//result.set_skillid(skillId);
	//result.set_usercid(m_pPart->GetMasterCid());

	//m_pMaster->BroadCastData(EMODULE_ID_SKILL, LOGIC_TO_CLIENT_SKILL_RESULT_BROADCAST, (ProtoBufBase*)&result, true);

	//给buff

	tmplist.push_back(m_pPart->GetMasterCid());
	m_pPart->SkillResult(skillId, pSkill->_pSkillmeta, m_curDamageCount, m_focoTime, tmplist);

	//技能一次释放完成，需要删通知删除
	m_pPart->RemoveSkillFightInfo(m_nGlobelID);
	return;
Exit0:
	m_pPart->KillTimedo(m_nGlobelID);
	m_pPart->RemoveSkillFightInfo(m_nGlobelID);

}

void SkillFlash::OnDamageTimedoPlayer(uint32_t skillId, cList & vtargetList)
{
	OnDamageTimedo(skillId);
}